<?php header("Content-Type:text/xml; charset=utf-8");
 include("inc/db_config.inc"); ?>
<?php
  //for php?name=PHP">PHP 4.x/5.x/6.x
    if (isset($_REQUEST['cid'])) {
	$cid=$_REQUEST['cid'];
    $result_cata = mysql_query("select * from type where id=$cid");
    $row_cata = mysql_fetch_array($result_cata);
    $cata_name = $row_cata['name'];
    $s2="select * from info where type='$cid' order by id desc";
}else{
    $s2="select * from info order by id desc";
}
  echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
  echo "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n";
  echo "<channel>\n";
  echo "<title><![CDATA[".$cata_name."--秀范网博客频道]]></title>\n";
  echo "<atom:link href=\"http://www.ouyo.info/rss.php\" rel=\"self\" type=\"application/rss+xml\"/>";
  echo "<description><![CDATA[http://www.ouyo.info]]></description>\n";
  echo "<link>http://www.ouyo.info/</link>\n";
  echo "<language>zh-cn</language>\n";
  echo "<docs>WHY100000.COM Document Center</docs>\n";
  echo "<generator>Rss Generator ByWWW.WHY100000.COM</generator>\n";
  $rs2=mysql_query($s2,$conn);
  while($result2=@mysql_fetch_array($rs2)){
  
  $title = $result2['title'];
  $link = "http://www.ouyo.info/show.php?pid=".$result2['id'];
  $description = mb_substr(strip_tags($result2['content']),0,100,'utf-8');
  /*
  $ssl="select username from sf_user where id='$result2[pubid]'";
          $rssl=mysql_query($ssl,$sql);
          $resultl=mysql_fetch_array($rssl);
          echo $resultl['username'];
                	 
  $author = $resultl['username'];
  */ 
  $author = "admin";
  $pubDate = $result2['data'];
  create_item($title, $link, $description, $author, $pubDate);
  }
  echo "</channel></rss>\n";
  function create_item($title_data, $link_data, $description_data, $author_data, $pubDate_data)
  {
    echo "<item>\n";
    echo "<title><![CDATA[$title_data]]></title>\n";
    echo "<link><![CDATA[$link_data]]></link>\n";
    echo "<description><![CDATA[$description_data]]></description>\n";
    echo "<author><![CDATA[$author_data]]></author>\n";
    echo "<pubDate><![CDATA[$pubDate_data]]></pubDate>\n";
    echo "</item>\n";
  }
  
?>